﻿//Main part of the script
$(document).ready(function () {
    //segment: Initialize
    //页面滑入效果，初始化;
    $("#Button1").click(function () {
        if ($("#DropDownList1").val() == "年" && $("#Label1").val() == "") {
            $("#mytable", parent.document.body).attr("src", '../mytable.aspx?bYear=' + $("#DropDownList2").val()
            + '&eYear=' + $("#DropDownList5").val() + "&granularity=1");
        }
        else if ($("#DropDownList1").val() == "月" && $("#Label1").val() == "") {
            $("#mytable", parent.document.body).attr("src", '../mytable.aspx?bYear=' + $("#DropDownList2").val()
            + '&eYear=' + $("#DropDownList5").val() + '&bMonth=' + $("#DropDownList3").val() + '&eMonth='
            + $("#DropDownList6").val() + "&granularity=2");
        }
        else if ($("#DropDownList1").val() == "日" && $("#Label1").val() == "") {
            $("#mytable", parent.document.body).attr("src", '../mytable.aspx?bYear=' + $("#DropDownList2").val()
            + '&eYear=' + $("#DropDownList5").val() + '&bMonth=' + $("#DropDownList3").val() + '&eMonth='
            + $("#DropDownList6").val() + '&bDay=' + $("#DropDownList4").val() + '&eDay='
            + $("#DropDownList7").val() + "&granularity=3");

        }
    });
    $(".areabt").click(function () {
         //$("#mytable", parent.document.body).attr("src", "mytable.aspx?condition='test'");
         //.attr("src", 'mytable.aspx?bYear=' + $("#DropDownList2").val()+ '&eYear=' + $("#DropDownList5").val() + "&granularity=1");
    });
});